IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spReportsFoldersReadyForMerging_Create')
	BEGIN
		PRINT 'Dropping Procedure spReportsFoldersReadyForMerging_Create'
		DROP  Procedure  spReportsFoldersReadyForMerging_Create
	END

GO

PRINT 'Creating Procedure spReportsFoldersReadyForMerging_Create'
GO
CREATE Procedure dbo.spReportsFoldersReadyForMerging_Create
	( 	  
	  @tuser char(8) = null, 
		@FILENO char(20), 
		@d_folder varchar(50) = null, 
		@d_loc varchar(50) = null, 
		@ILPNO char(20) = null, 
		@a_code char(8) = null, 
		@a_desc char(30) = null, 
		@a_from char(10) = null, 
		@a_to char(10) = null, 
		@d_status varchar(50) = null, 
		@d_match bit = null, 
		@d_exist bit = null, 
		@FSTATUS char(10) = null, 
		@LOCNO char(10) = null, 
		@d_accno varchar(50) = null, 
		@d_doctype varchar(50) = null, 
		@d_lasttran DateTime = null
	)
AS
  /* 
    ------------------------------------------------------------------------------
    - Change History
    - --------------
    - Date          Description
    ------------------------------------------------------------------------------
    - 10/15/2007    Initial version created
    ------------------------------------------------------------------------------
  */

	-- Declare the required variables

	-- Create the required new record
	INSERT INTO ReportsFoldersReadyForMerging
	  (
		tuser,
			FILENO,
			d_folder,
			d_loc,
			ILPNO,
			a_code,
			a_desc,
			a_from,
			a_to,
			d_status,
			d_match,
			d_exist,
			FSTATUS,
			LOCNO,
			d_accno,
			d_doctype,
			d_lasttran	  
	  )
	VALUES
	  (
		@tuser,
			@FILENO,
			@d_folder,
			@d_loc,
			@ILPNO,
			@a_code,
			@a_desc,
			@a_from,
			@a_to,
			@d_status,
			@d_match,
			@d_exist,
			@FSTATUS,
			@LOCNO,
			@d_accno,
			@d_doctype,
			@d_lasttran
	  )

	-- Handle any errors
	IF @@ERROR != 0
	BEGIN
		RAISERROR('spReportsFoldersReadyForMerging_Create: Unable to Insert a new ReportsFoldersReadyForMerging', 10, 1)
		RETURN
	END

	-- Return the newly created ID
	SELECT	@@IDENTITY AS 'ReportsFoldersReadyForMerging_ID'

	-- Return to calling method
	RETURN 

GO
